package com.real.fact.web.sale.domain;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

public class SaleFilter {

  private Date dateFrom;
  
  private Date dateEnd;
  
  private List<Ticket> ticketTypes = new ArrayList<Ticket>();
  
  private PayedFilter payedOption = PayedFilter.BOTH;

  public SaleFilter(final Date dateFrom, final Date dateEnd) {
    this.dateFrom = dateFrom;
    this.dateEnd = dateEnd;
  }

  public void addTicketType(final Ticket ticket) {
    ticketTypes.add(ticket);
  }
  
  public List<Ticket> getTicketTypes() {
    return Collections.unmodifiableList(ticketTypes);
  }
  
  public Date getDateFrom() {
    return dateFrom;
  }

  public void setDateFrom(Date dateFrom) {
    this.dateFrom = dateFrom;
  }

  public Date getDateEnd() {
    return dateEnd;
  }

  public void setDateEnd(Date dateEnd) {
    this.dateEnd = dateEnd;
  }

  public enum PayedFilter {
    ONLY_PAYED,
    ONLY_UNPAYED,
    BOTH
  }

  public PayedFilter getPayedOption() {
    return payedOption;
  }

  public void setPayedOption(PayedFilter payedOption) {
    this.payedOption = payedOption;
  }
  
}
